package com.yunshang.shoppingmall.service.impl;

import com.yunshang.shoppingmall.common.MessageConstants;
import com.yunshang.shoppingmall.common.Response;
import com.yunshang.shoppingmall.entity.Cart;
import com.yunshang.shoppingmall.mapper.CartMapper;
import com.yunshang.shoppingmall.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("cartService")
public class CartServiceImpl implements CartService {

    @Autowired
    CartMapper cartMapper;

    @Override
    public int deleteByPrimaryKey(Integer shoppingId) {
        return  cartMapper.deleteByPrimaryKey(shoppingId);
    }

    @Override
    public int insert(Cart record) {
        return  cartMapper.insert(record);
    }

    @Override
    public int insertSelective(Cart record) {
        return cartMapper.insertSelective(record);
    }

    @Override
    public Cart selectByPrimaryKey(Integer shoppingId) {
        return cartMapper.selectByPrimaryKey(shoppingId);
    }

    @Override
    public int updateByPrimaryKeySelective(Cart record) {
        return  cartMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Cart record) {
        return  cartMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateLogByOrderNoAndNumber(String logisticalNo, List<String> orderList, String productCount) {
        return cartMapper.updateLogByOrderNoAndNumber(logisticalNo,orderList,productCount);
    }

    @Override
    public int updateLogByOrderNo(String logisticalNo, List<String> orderList) {
        return cartMapper.updateLogByOrderNo(logisticalNo,orderList);
    }


    @Override
    public int updateLogType(Integer logisticsType, String orderNo, Integer addressId) {
        return cartMapper.updateLogType(logisticsType,orderNo,addressId);
    }


    @Override
    public List<Cart> selectProductByIds(String ids) {
        return cartMapper.selectProductByIds(ids);
    }

    @Override
    public int upCartStatus(List<String> ids, String orderNo) {
        return cartMapper.upCartStatus(ids,orderNo);
    }


    @Override
    public List<Cart> selectList(String orderNo) {
        return cartMapper.selectList(orderNo);
    }

    @Override
    public List<Cart> selectByOrderNo(String orderNo) {
        return cartMapper.selectByOrderNo(orderNo);
    }

    @Override
    public Cart selectCart(Integer productId, Integer guigeId, Integer userId) {
        return cartMapper.selectCart(productId,guigeId,userId);
    }

    @Override
    public int selectCartProListByUserId(int userId) {
        return cartMapper.selectCartProListByUserId(userId);
    }

}
